export const name = 'sdp_project'
export const module = 'sdp_project'
export const title = 'SdpProject'

import { ref } from 'vue'
export function init(self) {
  let columns = [
  ]
  if (columns.length == 0) {
    columns = [
      {
        prop: 'id',
        label: 'id',
      },
      {
        prop: 'workspace_name',
        label: 'workspace_name',
        sort_by_gbk: true,
      },
      {
        prop: 'group_name',
        label: '组名',
        sort_by_gbk: true,
      },
      {
        prop: 'name',
        label: 'name',
        sort_by_gbk: true,
      },
      {
        prop: 'root_path',
        label: '路径',
        sort_by_gbk: true,
      },
      {
        prop: 'tables',
        label: 'tables',
        sort_by_gbk: true,
      },
      {
        prop: 'remark',
        label: 'remark',
        sort_by_gbk: true,
      },
      {
        prop: 'extra_info',
        label: 'extra_info',
        sort_by_gbk: true,
      },
    ]
  }
  const obj = {
    name,
    module,
    title,
    columns,
    editColumns: [
      {
        prop: 'id',
        label: 'id',
        disabled: true,
      },
      {
        prop: 'workspace_name',
        label: 'workspace_name',
      },
      {
        prop: 'group_name',
        label: '组名',
      },
      {
        prop: 'name',
        label: 'name',
      },
      {
        prop: 'root_path',
        label: '路径',
      },
      {
        prop: 'tables',
        label: 'tables',
      },
      {
        prop: 'remark',
        label: 'remark',
      },
      {
        prop: 'extra_info',
        label: 'extra_info',
      },
    ],

    queryColumns: [
    ],

    remoteConfig: {
      count: {module, method: 'count'},
      list: {module, method: 'list'},
      export_excel: {module, method: 'export_excel'},
      edit: {module, method: 'update', keys: [
        'id',
      ]},
      add: {module, method:'add'},
      delete: {module, method: 'delete', keys: [
        'id',
      ]},
    }
  }
  for(let p in obj) {
    self[p] = ref(obj[p])
  }
}
